<div class="photo">
<div class="medium-photo-wrapper">

<a href="index.php?view=show&id=<?php echo $photo['id']; ?>" class="medium-pic"><img src="photos/medium/<?php echo $photo['id']; ?>.jpg" alt="<?php echo safe_output($photo['title']); ?>" /></a>
</div>
<div class="medium-photo-info">
<span class="title"><a href="index.php?view=show&id=<?php echo $photo['id']; ?>"><?php echo safe_output($photo['title']); ?></a></span>
<span class="created-at"><?php echo format_date($photo['created_at']); ?></span>
<span class="fullname">by <a href="<?php echo safe_output($photo['discuss_url']); ?>"><?php echo safe_output($photo['fullname']); ?></a> </span>
<span class="votes"><b>Votes <?php echo $photo['vote_cache']; ?></b></span>

<span class="tags">
 Tags:
        <?php $tags = photo_tags($photo['id']); ?>
        <?php foreach($tags as $tag): ?>
             <a href="index.php?view=by_tag&tag=<?php echo safe_output($tag['name']); ?>"><?php echo safe_output($tag['name']); ?></a>
				<?php endforeach; ?>
      </span>
<span class="theme-title">theme <a href="index.php?view=themes&theme_id=<?php echo $photo['theme_id']; ?>"><?php echo $photo['theme']; ?><a/></span>

<?php
session_start();
if(checkIfAdmin()){
	printf("<a href='index.php?view=delete&id=%s' class=\"theme-title\">delete</a>", $photo['id']);
}
?>

<div class="clear-fix"></div>
</div>

<div class="clear-fix"></div>
</div>
